The present invention is related generally to the field of computer graphics, and more particularly, to determining from a sample of pixels the presence of graphics data including two or fewer color levels.
As display devices of various sizes and increased resolution have been developed and the demand for them have increased, the ability to resize and resample source images and create destination images to take advantage of the various sized and higher resolution displays is a desirable operation. However, the resampled destination image must retain an acceptable image quality compared to the source image. That is, the destination image should appear to retain at least a similar resolution, and have appear to have nearly the same color balance, contrast, and brightness as the original source image. Otherwise, rather than accurately reproducing the source image, the resampling operation will compromise the image quality by introducing image distortion. As a result, various resampling algorithms have been developed in order to create high quality graphics images.
Graphics images that are displayed on a display device often consist of mixed types of graphics images, such as a video graphics images displayed simultaneously with stationary images of text or line borders. A common example of such a graphics image is a Web page having a video portion separated from an adjacent text portion by a line border. Another example would be a computer desktop having in a multimedia player window a video image and in a background window or on the desktop text images.
Resampling a source graphics image having mixed types of graphics images, such as video and text, poses special challenges because the resampling algorithm used for one type of graphics image may not be efficient, or effective for resampling another type of graphics image. For example, resampling graphics data representing text images differs from resampling graphics data representing video in that the resampling process used to interpolate destination pixels from the source image for text typically assumes some sort of plateau model around each pixel with no overshoots between pixels of different color levels. Therefore, only input samples either side of an output sample contribute to the value of the destination pixel. As a result, if text resampling models are used for graphics data representing video, it tends to produce blurry transitions on a computer monitor, and original image line structure is often visible. Moreover, algorithms for resampling bitmaps are generally more difficult to design than those for resampling video signals, because there is an expectation of presenting clear and legible text in an output image. Also, there is no restriction in how close the viewer gets the monitor, unlike video where 3xc3x97 picture height is the recommended minimum viewing distance.
As a result, graphics data representing text is sometimes treated differently than graphics data representing non-text images for various graphics operations. Where the text and non-text images are treated differently, it becomes necessary to be able to identify the different types of graphics data. One such method of text detection is described in U.S. Pat. No. 5,845,010 to Silverbrook et al. issued Dec. 1, 1998. As described therein, pixels of a JPEG cell are tested for xe2x80x9csaturationxe2x80x9d to identify graphics data containing text, where saturation refers to the pixel being within a defined percentage of full color saturation. Various criteria can be set to improve the identification method. For example, the cell will be identified as text if a defined percentage of pixels in the cell are saturated, or if a defined percentage of pixels in the cell are within a defined intensity slope between two saturated pixels. However, the method described in the aforementioned patent is susceptible to incorrectly identifying video containing saturated elements as text. Similarly, graphics data including text where the pixels are not fully xe2x80x9csaturatedxe2x80x9d may escape detection. Inaccurate identification of text in graphics data may result in treating the different types of graphics data incorrectly, possibly causing image distortion and reduced image quality and resolution.
Therefore, there is a need for an alternate method and system for identifying graphics data containing text images.
The present invention relates to a system and method for identifying whether sample values of pixel samples in a sample region have two or fewer different sample values represented. Such a system and method may be used to identify graphics information representing text images. The system performs the identification operation by hierarchically sub-dividing regions with even numbers of samples into two sub-regions with even number of samples, and re-dividing until all regions contain just two samples each. Each two sample region is then processed to determine if it contains two or one sample levels, returning the sorted sample values and number of different levels to its parent region in the hierarchy. The parent then determines if there are a tally of 3 or more, 2, or 1 sample levels in its two regions, and returns this tally and the sorted sample values if 2 levels lie in the region. This process continues up the hierarchy until the entire region of interest can determine if 3 or more, 2, or 1 sample levels lie within it. The tally value generated for the sample region is indicative of whether two or fewer sample values are represented by the samples of the sample region.